<?php
  //Genesis Software Manual - Page 18

  $pdf->AddPage();

  //$pdf->Image('./Genesis/Gen-soft/Gsm-11.png',0,0,210 ,297);
  //add_raster($pdf);

  $pdf->SetDrawColor(0,0,0);
  $pdf->SetTextColor(0,0,0);
  $pdf->SetFont('arial','',10);
  $pdf->SetLineWidth(0.4);

  set_text_space(4.4);
 
  $margin = array
  (
    'tab_1' => 30,
    'tab_2' => 37,
    'tab_3' => 44,
    'tab_4' => 60
    
  );
  
  new_line(35);

  $pdf->Bookmark('2. $C00004 (Control Port)',2,current_line() - 10);
  $pdf->Text($margin['tab_2'],current_line(),'2.');
  $pdf->Text($margin['tab_3'],current_line(),'$C 0 0 0 0 4 (CONTROL PORT)');

  new_line();
  new_line();

  $pdf->Text($margin['tab_3'],current_line(),'READ: STATUS REGISTER');

  new_line();
  new_line();

  bit_field_table($margin['tab_3'] +1,current_line() - 3,15.4,7,
    array('*','*','*','*','*','*','EMPT','FULL'));
  bit_field_table($margin['tab_3'] +1 + (15.4 / 2),current_line() - 3 + 7,15.4,7,
    array('F','SOVR','C','ODD','VB','HB','DMA','PAL'));
  
  caption_16_bit_field($margin['tab_3'],190,'$ C 0 0 0 0 4');

  $pdf->SetFont('arial','',10);
  set_text_space(4.5);
  

  new_line(current_line() + 8);
  $pdf->Text($margin['tab_3']-2,current_line(),'* NO USE');
  
  new_line();

  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'EMPT.. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'WRITE FIFO EMPTY');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'FULL.. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'WRITE FIFO FULL');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'F.. .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'V interrupt happened');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'SOVR.. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'Sprites overflow occurred, too many in one line.');
      $pdf->Text($margin['tab_4'] + 4 + 2 ,new_line(),'Over 17 in 32 cell mode.');
      $pdf->Text($margin['tab_4'] + 4 + 2 ,new_line(),'Over 21 in 40 cell mode.');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'C.. .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'Collision happen between non-zero pixels in two sprites.');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'ODD .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'Odd fram in interlace mode.');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'Even fram in interlace mode.');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'VB .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'During V blanking');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'HB .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'During H blanking');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'DMA .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'DMA BUSY');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
  new_line();
    $pdf->Text($margin['tab_3']-2,current_line(),'PAL .. ..');
    $pdf->Text($margin['tab_4'],current_line(),'1:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'PAL MODE');
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'0:');
    $pdf->Text($margin['tab_4'] + 4 ,current_line(),'NTSC MODE');
  new_line();
  new_line();
  new_line();
    $pdf->Text($margin['tab_4'],current_line(),'WRITE1: REGISTER SET');
  new_line();
  new_line();


  
  //new_line(186);
  bit_field_table($margin['tab_3'] +1,current_line() - 3,15.4,7,
    array('1','0','0','RS4','RS3','RS2','RS1','RS0'));
  bit_field_table($margin['tab_3'] +1 + (15.4 / 2),current_line() - 3 + 7,15.4,7,
    array('D7','D6','D5','D4','D3','D2','D1','D0'));
  
  caption_16_bit_field($margin['tab_3'],190,'$ C 0 0 0 0 4');
  
  $pdf->SetFont('arial','',10);
  set_text_space(4.2);
  

  new_line(current_line() + 5);
  $pdf->Text($margin['tab_3'],current_line(),'* $C00004 and $C00006 are functionally equivalent.');
  
  new_line();
  new_line();
    $pdf->Text($margin['tab_3'] + 3,current_line(),'RS4 ~ RS0:');
    $pdf->Text($margin['tab_3'] + 29,current_line(),'Register No.');
  new_line();
    $pdf->Text($margin['tab_3'] + 3,current_line(),'D7 ~ D0:');
    $pdf->Text($margin['tab_3'] + 29,current_line(),'Data');

  new_line();
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'* You must use word or long word access to the VDP ports when setting the registers.');
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'  Long word access is equivalent tot two word accesses, with D31 - D16 written first.');



  add_footer($pdf,'02/19/92','11');

?>
